[?php use_helper('I18N', 'Date') ?]
[?php include_partial('<?php echo $this->getModuleName() ?>/assets') ?]

<div id="sf_admin_container">
 
<?php if ($this->configuration->isExportationEnabled()): ?>
  [?php include_partial('exportation', array('configuration' => $configuration)) ?]
<?php endif ?>

<h1>
  <?php $title = $this->configuration->getValue('list.title') ?>
  <?php if (is_string($title) && (strlen($title) > 3) && (substr($title, 0, 2) == '%_') && (substr($title, -1, 1) == '%')): ?>
    [?php include_partial("<?php echo $this->getModuleName()?>/<?php echo str_replace(array('%', '_'), array('', ''), $title) ?>", array('configuration' => $configuration, 'helper' => $helper, 'filters' => (isset($filters)? $filters : null))) ?]
  <?php else: ?>
    [?php echo <?php echo $this->getI18NString('list.title') ?> ?]
  <?php endif ?>
</h1>

  [?php include_partial('<?php echo $this->getModuleName() ?>/list_slot_actions', array('helper' => $helper <?php echo ($this->configuration->hasCart()? ', \'cart_objects\' => $cart_objects' : "")?>)) ?]

  <div id="sf_admin_header">
    [?php include_partial('<?php echo $this->getModuleName() ?>/list_header', array('pager' => $pager)) ?]
  </div>

<?php if ($this->configuration->hasFilterForm()): ?>
<?php if ($this->configuration->getFilterCredentials()): ?>
[?php if ($sf_user->hasCredential(<?php echo $this->asPhp($this->configuration->getFilterCredentials()) ?>)): ?]
<?php endif; ?>

  <div align="center">
    <div id="sf_admin_bar">
      [?php if ( $sf_user->hasAttribute('<?php echo $this->getModuleName() ?>.hide_filters') && $sf_user->getAttribute('<?php echo $this->getModuleName() ?>.hide_filters') ): ?]
        
        <span class="filters_hidden">
          [?php echo __('Filtered list of items.',array(), 'sf_admin')?]
          [?php echo link_to_function(__('New search', array(), 'sf_admin'), "jQuery('div.sf_admin_filter').show(); jQuery('#sf_admin_filters_body').show(); jQuery(this).hide();") ?]
        </span>
      [?php endif ?]
      [?php include_partial('<?php echo $this->getModuleName() ?>/filters', array('form' => $filters, 'configuration' => $configuration, 'hideFilters' => $sf_user->hasAttribute('<?php echo $this->getModuleName() ?>.hide_filters') && $sf_user->getAttribute('<?php echo $this->getModuleName() ?>.hide_filters'))) ?]
    </div>
  </div>
<?php if ($this->configuration->getFilterCredentials()): ?>
[?php endif; ?]
<?php endif; ?>
<?php endif; ?>

  [?php include_partial('<?php echo $this->getModuleName() ?>/flashes') ?]

  <div id="sf_admin_content">
<?php if ($this->configuration->getValue('list.batch_actions')): ?>
    <form id="sf_admin_list_form" action="[?php echo url_for('<?php echo $this->getUrlForAction('collection') ?>', array('action' => 'batch')) ?]" method="post">
<?php endif; ?>
    [?php include_partial('<?php echo $this->getModuleName() ?>/list', array('pager' => $pager, 'sort' => $sort, 'helper' => $helper)) ?]
    <ul class="sf_admin_actions">
      [?php include_partial('<?php echo $this->getModuleName() ?>/list_batch_actions', array('helper' => $helper)) ?]
      [?php include_partial('<?php echo $this->getModuleName() ?>/list_actions', array('helper' => $helper)) ?]
    </ul>
<?php if ($this->configuration->getValue('list.batch_actions')): ?>
    </form>
<?php endif; ?>
  </div>

  <div id="sf_admin_footer">
<?php if ($this->configuration->hasCart()): ?>
    [?php if (count($cart_objects) > 0): ?]
      <div id="batch_edition_cart">
        [?php include_partial('<?php echo $this->getModuleName() ?>/cart', array('cart_objects' => $cart_objects)) ?]
      </div>
    [?php endif ?]
<?php endif ?>
    [?php include_partial('<?php echo $this->getModuleName() ?>/list_footer', array('pager' => $pager)) ?]
  </div>
</div>

[?php if ($configuration->isExportationEnabled()): ?>
  [?php javascript_tag() ?]
    jQuery(window).bind('resize', function() { 
      jQuery('#sf_admin_exportation').centerHorizontally();
      jQuery('#sf_admin_exportation_resizable_area').ensureVisibleHeight();
    });
  [?php end_javascript_tag() ?]
[?php endif ?]
